<?php
namespace Common\Taglib;

class u
{
    public function run($opt)
    {
        $uid = intval($opt['uid']);
        $myuid = session('ytata.uid');
        $u = D('User');
        $show['user'] = $u->get_user_one($uid, true);
        $show['user']['answer_click'] = D('Answer')->get_click_total($uid);
        $show['user']['follow'] = D('FollowUser')->get_follow_count($uid, 1);
        $show['user']['fans'] = D('FollowUser')->get_follow_count($uid, 2);
        $show['user']['is_follow'] = 0;
        $show['user']['count_track'] = D('UserTrack')->get_count($uid, 2);
        if (!empty($myuid)) {
            $chenk = D('FollowUser')->chenk_follow_user($myuid, $uid);
            if ($chenk) {
                $show['user']['is_follow'] = 1;
            }
        }
        $u->edit_click($uid);//更新点击次数
        return $show;
    }
}